package pl.javarsovia.javarsovia4android.util;

import pl.javarsovia.javarsovia4android.domain.Identifiable;
import pl.javarsovia.javarsovia4android.domain.Partner;

import java.util.List;

public class CollectionUtils {

    public static <T extends Identifiable> T findDomainById(List<T> objects, String id) {
        for (T object : objects) {
            if (object.getId().equals(id))
                return object;
        }
        return null;
    }

    public static boolean isEmpty(List<Partner> list) {
        return list == null || list.size() == 0;
    }
}
